package com.autoplaza;

import android.app.Activity;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class DetalleTexto extends Activity {
	/**
	 * @see android.app.Activity#onCreate(Bundle)
	 */
	String arrayequipamiento[];
	LinearLayout ll;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.detalletexto);
		
		int size = Utils.getScreenSize2(DetalleTexto.this);
		if( size == 1){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 30));
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(30, 30));
		}		
		if( size == 2){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 60));	
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(45, 45));

		}		
		if( size == 3){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 80));
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(80, 80));

		}
		
		ll = (LinearLayout) findViewById(R.id.ll_equip);
		Bundle extras = getIntent().getExtras();
		if(extras != null){
			TextView encabezado = (TextView) findViewById(R.id.encabezado);
			encabezado.setText(""+extras.getString("encabezado"));
			
			if(extras.getString("equipamiento").equals("si")){
				arrayequipamiento=extras.getString("texto").trim().split(";");
				for(int i=0; i<arrayequipamiento.length; i++){
					Log.i("TAG", ""+arrayequipamiento[i]);
					TextView tv=new TextView(getApplicationContext());
					tv.setTextSize(14);
					tv.setTextColor(Color.BLACK);
					if(!arrayequipamiento[i].endsWith(":")){



						tv.setText("      *"+arrayequipamiento[i]);



					}else{
						tv.setTypeface(null,Typeface.BOLD);

						tv.setText(""+arrayequipamiento[i]);

					}

					ll.addView(tv);
				}
			}else{
				TextView texto  = (TextView) findViewById(R.id.textView1);
				texto.setText(extras.getString("texto"));
				texto.setTextSize(14);

			}

		}




	}
}